package com.financing.platform.dao.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IFpShopBackgroundDao;
import com.financing.platform.dto.FpShopBackgroundDTO;
import com.financing.platform.util.SqlName;
/**
 * fp_shop_background  
 * 背景图片表 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpShopBackgroundDao")
public class FpShopBackgroundDaoImpl extends BaseDaoImpl implements IFpShopBackgroundDao {


	@Override
	public int insert(FpShopBackgroundDTO fpShopBackground) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.FpShopBackgroundSql.insert, fpShopBackground);
	}

	@Override
	public void update(FpShopBackgroundDTO fpShopBackground) throws SQLException {
		this.sqlMapClient.update(SqlName.FpShopBackgroundSql.update, fpShopBackground);
	}

	@Override
	public void updateForce(FpShopBackgroundDTO fpShopBackground) throws SQLException {
		this.sqlMapClient.update(SqlName.FpShopBackgroundSql.updateForce, fpShopBackground);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClient.delete(SqlName.FpShopBackgroundSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpShopBackgroundDTO> queryList(FpShopBackgroundDTO fpShopBackground) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.FpShopBackgroundSql.queryList, fpShopBackground);
	}

	@Override
	public int queryListCount(FpShopBackgroundDTO fpShopBackground) throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.FpShopBackgroundSql.queryListCount, fpShopBackground);
	}

	@Override
	public FpShopBackgroundDTO loadById(Integer id) throws SQLException {
		return  (FpShopBackgroundDTO)this.sqlMapClient.queryForObject(SqlName.FpShopBackgroundSql.loadById,id);
	}

	
 	
}
